Do Elections Improve Constituency Responsiveness?
Evidence from U.S. Cities

Darin Christensen (darinc@luskin.ucla.edu)
Simon Ejdemyr (ejdemyr@gmail.com)

July 30, 2018 

#---------------------------------------------------------------------

TABLE OF CONTENTS/

The zipped "replication" folder contains four sub-directories: (1) code, (2) data, (3) figures, and (4) tables. It also contains an R profile file (*.rproj); opening this file in RStudio will be the simplest way to work with the code and data files, as there will be no need to further specify working directories. 

#---------------------------------------------------------------------

CODE/

The code directory contains the scripts needed to reproduce every figure and table in both the body of the paper and the supporting information. (Scripts that include *si* correspond to figures and tables from the supporting information.)

To reproduce any of the figures or tables, open _master.R. At the top of this script, you'll load the Preamble() function. This function also loads all the R packages needed for the subsequent analysis. If you have not already installed these packages, change the only argument of Preamble() to install = TRUE. 

Each script is named for the table or figure that it reproduces in the text. figure-1.R, for example, reproduces figure 1. 

#---------------------------------------------------------------------

DATA/

The data directory contains datasets required to reproduce the figures and tables. We have tried to give the datasets informative titles, but their contents can be easily discerned by looking through the scripts; nearly every code file begins by clearing the workspace and loading one of these datasets.

#---------------------------------------------------------------------

FIGURES/

Folder for the figures produced by the scripts. All figures are produced as PDFs.

#---------------------------------------------------------------------

TABLES/

Folder for the tables produced by the scripts. All tables are produced as tex files.

#---------------------------------------------------------------------

SESSION INFO/

R version 3.5.0 (2018-04-23)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS High Sierra 10.13.6

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
 [1] readr_1.1.1        zoo_1.8-1          lubridate_1.7.4    dplyr_0.7.4       
 [5] scales_0.5.0       gridExtra_2.3      ggplot2_2.2.1.9000 xtable_1.8-2      
 [9] stargazer_5.2.1    lfe_2.6-2291       Matrix_1.2-14      data.table_1.11.0 
[13] beepr_1.2         

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.17     compiler_3.5.0   pillar_1.2.2     plyr_1.8.4      
 [5] bindr_0.1.1      tools_3.5.0      tibble_1.4.2     gtable_0.2.0    
 [9] lattice_0.20-35  pkgconfig_2.0.1  rlang_0.2.0      yaml_2.1.19     
[13] parallel_3.5.0   bindrcpp_0.2.2   withr_2.1.2      stringr_1.3.0   
[17] hms_0.4.2        glue_1.2.0       R6_2.2.2         Formula_1.2-3   
[21] magrittr_1.5     assertthat_0.2.0 colorspace_1.3-2 sandwich_2.4-0  
[25] stringi_1.2.2    lazyeval_0.2.1   munsell_0.4.3    audio_0.1-5  